|
| Run file for !MEExample
|

| Standard stuff. CarryOn is used later as a way of stopping MEExample from here, without
| having to resort to a nasty, non-multitasking Error command, or an inappropiate "Obey"
Set MEExample$Dir <Obey$Dir>
Set MEExample$CarryOn "True"
IconSprites <MEExample$Dir>.!Sprites

| Standard internationalisation stuff
Run <MEExample$Dir>.Resources.ResFind MEExample


| Let's start with a simple example - used purely as an information window
MEExampleRes:MultiError -template MEExampleRes:Templates -text "This is a simple message with no implications for your program. Notice the customised template."

| We need RISC OS 7, for the sake of demonstration. Notice we now unset CarryOn.
| Also the short forms of the switches are used.
RMEnsure UtilityModule 7.00 MEExampleRes:MultiError -t MEExampleRes:Templates -m MEExampleRes:Messages -k error_minimumos -q
RMEnsure UtilityModule 7.00 UnSet MEExample$CarryOn

| Here's an example of using parameter substitution in the message.
| Notice, also, that including an URL reveals a nice new button.
MEExampleRes:MultiError -t MEExampleRes:Templates -m MEExampleRes:Messages -k error_testparams -p One -p Two -p Three -p Four -n

| Lastly an example of trying to load a module. Note that I use an "IfThere". This is good
| practice as otherwise we'd get a particularly unhelpful and cryptic (for the user), non-multitasking
| wimp error message complaining about AdamsMod not being found if it's not already in System
RMEnsure AdamsMod 1.00 IfThere System:Modules.AdamsMod Then RMLoad System:Modules.AdamsMod
RMEnsure AdamsMod 1.00 MEExampleRes:MultiError -t MEExampleRes:Templates -m MEExampleRes:Messages -k error_needadamsmod
RMEnsure AdamsMod 1.00 UnSet MEExample$CarryOn


| Finally set wimpslot and off we go (so long as no problems were encountered earlier)
WimpSlot -min 30K -max 30K
If "<MEExample$CarryOn>" = "True" Then Run <MeExample$Dir>.!RunImage

| It's all over... Time to tidy up our system variables
UnSet MEExample$CarryOn